bindFeishu.optionPage = {

    getUserDataGrid: function () {
        return {
            type: 'grid',
            page: true,
            id: 'bind-feishu-list-grid',
            url: bindFeishu.userUrl + '/queries',
            columns: bindFeishu.getGridColumns(),
            toolbar: [{
                type: 'button',
                text: '前往绑定',
                icon: 'submit',
                onClick: function () {
                    Gikam.getText(IFM_CONTEXT + '/feishu/feishu-login-config').done(req => {
                        req = JSON.parse(req)
                        window.location.href = req.bindPage
                    })
                }
            },],
            onCellClick: function (field, row) {
            },
            requestData: {
                id_EQ: workspace.user.id,
            },
            onLoadSuccess: function (data) {
                if (!Gikam.isEmpty(data)) {
                    this.activeRowByIndex(0);
                } else {
                }
            },
        }
    },

    create: function () {
        var _this = this
        Gikam.create('layout', {
            id: 'bind-feishu-list-layout',
            renderTo: workspace.window.$dom,
            center: {items: [_this.getUserDataGrid()]}
        })
    },

    init: function () {
        this.create()
    }
}